@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #333;
}

#chat-container {
    width: 95%;
    max-width: 700px;
    height: 95vh;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
    padding: 15px 20px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    margin: 0;
    font-size: 1.5em;
}

header p {
    margin: 4px 0 0;
    font-size: 0.9em;
    opacity: 0.9;
}

#messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 75%;
    line-height: 1.4;
    word-wrap: break-word;
}

.user {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.bot {
    background-color: #e9e9eb;
    color: black;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.bot img {
    max-width: 100%;
    border-radius: 15px;
    display: block;
    margin-top: 5px;
}

.loading {
    font-style: italic;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Spinner animation */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#input-area {
    padding: 15px;
    border-top: 1px solid #ddd;
}

.example-text {
    font-size: 0.8em;
    color: #666;
    margin: 0 0 8px 5px;
    text-align: center;
}

#input-form {
    display: flex;
    gap: 10px;
}

#message-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 12px 18px;
    font-size: 1em;
    transition: border-color 0.2s;
}

#message-input:focus {
    outline: none;
    border-color: #007bff;
}

#send-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.2s;
}

#send-button:hover {
    background-color: #0056b3;
}
#send-button:disabled {
    background-color: #a0c7ff;
    cursor: not-allowed;
}

